The invention relates to a method for correlating two signals wherein mutually time-displaced sampling values of the two signals are multiplied together and to determine a discrete value of the correlation function the average value of the multiplication results corresponding to the same time displacement is formed, and an arrangement for carrying out this method.
The correlation of two different signals (cross correlation) and the correlation of a signal with the same but time-displaced signal (auto correlation) is used in many fields either to obtain information on certain properties of the signals or to obtain a prediction of the future behaviour of the signals. A known field of use of the correlation technique is the contactless velocity measurement of moving objects and fluids which is necessary in many branches of process technology and automation technology. Examples are the flow measurement in multi-phase flows or solids transport in conduits. In such cases, the fact utilized is that from the flowing media or moved surfaces with two optical, acoustic or capacitive sensors disposed with predetermined spacing from each other in the flow direction noise signals can be obtained from which the aid of the correlation analysis the time of travel of the flow of medium or the moved surface between the two sensors can be deduced. For the time displacement between the correlated signals corresponding to the maximum of the cross correlation function is equal to the time of travel from the first sensor to the second sensor.
To simplify the signal processing in the correlator it is known to conduct the correlation not with continuous analog signals but with discrete sampling values taken at predetermined intervals and preferably being brought into a digital form. A further known simplification is that as signal values only the signs of the sensor signals are evaluated in a so-called polarity correlator. In this case the sampling values are binary signals which assume only the one or the other of two signal values.
The hitherto known digital correlators are complicated laboratory measuring apparatuses on the basis of a fixedly wired computer which supply as result on an oscillograph screen or an XY recorder the entire variation of the correlation function from which the measuring engineer must determine manually the position of the maximum which is the sole value of interest in contactless velocity measurement. A further disadvantage is the long computing time; conventional correlators calculate the correlation function serially so that for example to compute from 256 discrete values and N takings of the mean per correlation discrete value the correlation lasts 256.multidot.N units of time.
Only then can the maximum be determined. To shorten the computing time more complicated laboratory correlators are known which have 256 parallel-operating multiplying and integrating stages and in each sampling time calculate a new estimate for the entire correlation function. In this case, a maximum can be localized very soon but the expenditure is extremely high. Both methods are not possible for production measuring equipment, the first because of the long measuring time and the second because of the technical expenditure involved.
So-called delay correlators are further known which with the aid of a controllable delay path, a control circuit and a voltage-controlled oscillator continuously determine with a mainly analog technique the delay from the zero passage of the differentiated correlation function by a gradient method. These correlators have the defects of all analog techniques, such as poor integrability to a large circuit and temperature and long time constancy problems. Moreover, the principle of determining the maximum with the aid of a control itself is very critical in the great number of cases of correlation functions occurring practically which exhibit not only a maximum but besides the main maximum numerous secondary maxima due to the periodic signal components (e.g. circulating pumps in a conduit section). It is then perfectly possible for the control circuit to lock on a secondary maximum and thus give a completely erroneous measurement. A further problem is the recognition of the stationary condition. In this case the correlation function has no significant maximum and a random searching of the controller must be prevented by auxiliary means. Because of the inherent inertia of the control circuit sudden restarting can also lead to the shifting maximum moving out of the detection range.
The aforementioned problems both in the laboratory correlator and in the delay correlator have meant that in spite of the undeniable fundamental advantages the correlative measuring technique has not been put into practice in industry.
The problem underlying the invention is to provide a method which enables the rapid and reliable correlation of two signals with low expenditure, and an arrangement for carrying out the method.
Proceeding from a method of the type set forth at the beginning this problem is solved according to the invention in that the one signal is sampled with a sampling frequency which is a multiple of the sampling frequency of the other signal, that a number of the respective last sampling values of the more slowly sampled signal is stored, that each sampling value of the more rapidly sampled signal is multiplied simultaneously by all the stored sampling values of the more slowly sampled signal and that the respective multiplication results corresponding to the equal time displacement between the multiplied values are separately summated.
The essential advantage of the method according to the invention is that the calculation of the correlation function is carried out in each sampling time of the more quickly sampled signal simultaneously on a plurality of discrete values so that after a relatively short number of sampling periods a calculation has been made for each discrete value of the correlation function. The recognition of the maximum forming during the averaging process can be made very early compared with a serial correlator.
The circuitry expenditure necessary for carrying out the method according to the invention is small. A preferred embodiment of an arrangement for carrying out the method contains according to the invention means for sampling the two signals in the frequency ratio 1:k, a register having n stages for storing the n last sampling values of the more slowly sampled signal, n multiplier circuits which each receive at an input the content of a register stage and at the other input in parallel the sampling values of the more quickly sampled signal, a memory having m=k.multidot.n storage locations and a distributing circuit for introducing the multiplication results furnished by the multiplier circuits into the memory locations associated with the respective time displacements with addition to the preceding content.
Such an arrangement can be constructed in simple manner with commercially available integrated analog or digital circuits. A particularly advantageous embodiment resides in that the distributing circuit and the memory are formed by a microcomputer.
An advantageous further development of the method according to the invention resides in that in each case in a first phase of each of a plurality of successive cycles the n multiplication results obtained simultaneously in each sampling period of the quicker sampling are introduced in time with the quick sampling in parallel into a buffer store, and in that in a second phase of each cycle the multiplication results stored in the buffer store are read from the buffer store in a manner clocked to the working rate of the summation store and distributed amongst the storage locations of the summation store.
In this further development of the invention the frequency of the quick scanning is determined independently of the working frequency of the summation store and only by the rate at which the multiplication results can be introduced into the buffer store. Even if it is assumed that the buffer store does not operate more rapidly than the summation memory, this means a multiplication of the sampling frequency by the factor n because in each case n multiplication results are introduced in parallel into the buffer store. Moreover, there is a further increase of the maximum possible sampling frequency because the groups of multiplication results can be introduced into the buffer store unsorted into consecutive storage locations and need not be added to the preceding content.
The calculation of the entire correlation function takes place in about the same time as with direct introduction of the multiplication results into the summation memory but on the basis of sampling values which are obtained with a very much higher sampling frequency. In particular when constructed as polarity correlator, in which the multiplication results are 1-bit numbers, with usual commercial microcomputer components sampling frequencies of about 50 kHz are readily obtained.
Advantageous embodiments and further developments of the method according to the invention and the arrangement for carrying out the method are characterized in the subsidiary claims.